diff options
Diffstat (limited to 'src/routes/(app)/[username]')
6 files changed, 47 insertions, 19 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 5d9611a5..fc1fc93d 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -1,7 +1,6 @@ <script> import { invalidate } from "$app/navigation"; import { browser } from "$app/environment"; - import { hexToUint8Array } from "uint8array-extras"; import { copy, f, @@ -37,7 +36,7 @@ } = $derived(data); let { currency, npub, username: n, display } = $derived(subject); - let locale = loc(user); + let locale = $derived(() => loc(user)); let list = $state([]); let follow = async () => { @@ -136,7 +135,7 @@ <iconify-icon noobserver icon="ph:list-bold" width="32"></iconify-icon> </button> {#if subject.id === user?.id} - <a href="/settings/profile" class="btn contents"> + <a href="/settings/profile" class="btn contents" aria-label="Edit profile"> <iconify-icon noobserver icon="ph:pencil-bold" width="32" ></iconify-icon> </a> @@ -151,7 +150,9 @@ class="text-secondary mx-auto text-center lg:mx-0 break-words space-y-1" class:line-clamp-2={!showBio} onclick={toggleBio} - onkeydown={toggleBio} + onkeydown={(e) => (e.key === "Enter" || e.key === " ") && toggleBio()} + role="button" + tabindex="0" > <div> {subject.about} @@ -194,11 +195,20 @@ {lnaddr} </div> <div class="flex mb-auto gap-1"> - <button class="my-auto" onclick={() => copy(lnaddr)} + <button + type="button" + class="my-auto" + aria-label="Copy lightning address" + onclick={() => copy(lnaddr)} + > ><iconify-icon noobserver icon="ph:copy-bold" width="32" ></iconify-icon></button > - <a href={`/qr/${encodeURIComponent(lnaddr)}`} class="my-auto"> + <a + href={`/qr/${encodeURIComponent(lnaddr)}`} + class="my-auto" + aria-label="Show lightning address QR" + > <iconify-icon noobserver icon="ph:qr-code-bold" width="32" ></iconify-icon> </a> @@ -213,7 +223,12 @@ {profile} </div> <div class="flex mb-auto gap-1"> - <button class="my-auto" onclick={() => copy(profile)} + <button + type="button" + class="my-auto" + aria-label="Copy profile URL" + onclick={() => copy(profile)} + > ><iconify-icon noobserver icon="ph:copy-bold" width="32" ></iconify-icon></button > @@ -222,6 +237,7 @@ `${$page.url.protocol}//${profile}`, )}`} class="my-auto" + aria-label="Show profile URL QR" > <iconify-icon noobserver icon="ph:qr-code-bold" width="32" ></iconify-icon> @@ -236,13 +252,19 @@ {lnurl} </div> <div class="flex mb-auto gap-1"> - <button class="my-auto" onclick={() => copy(`lightning:${lnurl}`)} + <button + type="button" + class="my-auto" + aria-label="Copy LNURL" + onclick={() => copy(`lightning:${lnurl}`)} + > ><iconify-icon noobserver icon="ph:copy-bold" width="32" ></iconify-icon></button > <a href={`/${n}/accepted/${encodeURIComponent(`lightning:${lnurl}`)}`} class="my-auto" + aria-label="Show LNURL QR" > <iconify-icon noobserver icon="ph:qr-code-bold" width="32" ></iconify-icon> @@ -307,6 +329,7 @@ <button type="submit" class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex w-60" + aria-label="Reset password" > <div class="mx-auto flex"> <iconify-icon noobserver icon="ph:clock" width="32" diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 7d342994..a3ced17d 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -27,7 +27,9 @@ }; let pubkey = $state(); - if (user) user.savings = 0; + $effect(() => { + if (user) user.savings = 0; + }); let { host } = $derived($page.url); </script> diff --git a/src/routes/(app)/[username]/(profile)/followers/+page.svelte b/src/routes/(app)/[username]/(profile)/followers/+page.svelte index 28b4c6f0..13a8a65b 100644 --- a/src/routes/(app)/[username]/(profile)/followers/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/followers/+page.svelte @@ -24,10 +24,7 @@ data-sveltekit-preload-data="tap" rel="nofollow" > - <div - class="flex border-b last:border-b-0 py-4 text-2xl text-secondary" - :key={data.pubkey} - > + <div class="flex border-b last:border-b-0 py-4 text-2xl text-secondary"> <div class="mb-auto mr-2"> <div class="md:hidden"> <Avatar size={12} user={data} disabled={true} /> diff --git a/src/routes/(app)/[username]/(profile)/follows/+page.svelte b/src/routes/(app)/[username]/(profile)/follows/+page.svelte index 585cb32e..fe9dc81d 100644 --- a/src/routes/(app)/[username]/(profile)/follows/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/follows/+page.svelte @@ -27,7 +27,7 @@ data-sveltekit-preload-data="tap" rel="nofollow" > - <div class="flex py-4 text-lg text-secondary" :key={data.pubkey}> + <div class="flex py-4 text-lg text-secondary"> <div class="mb-auto mr-2"> <div class="md:hidden"> <Avatar size={12} user={data} disabled={true} /> diff --git a/src/routes/(app)/[username]/accepted/[text]/+page.svelte b/src/routes/(app)/[username]/accepted/[text]/+page.svelte index 1483a294..93a06903 100644 --- a/src/routes/(app)/[username]/accepted/[text]/+page.svelte +++ b/src/routes/(app)/[username]/accepted/[text]/+page.svelte @@ -10,7 +10,7 @@ let { data } = $props(); let { nfc, text } = $derived(data); let { username } = $derived(data.subject); - let url = `https://coinos.io/p/${username.toLowerCase()}`; + let url = $derived(() => `https://coinos.io/p/${username.toLowerCase()}`); let lnurl = $derived( `https://${PUBLIC_DOMAIN}/ln/${encode( @@ -29,7 +29,11 @@ > <div class="flex gap-2 mx-auto justify-center"> <!-- <img src="/images/bitcoin.png" class="w-16 h-16 my-auto" /> --> - <img src="/images/bitcoin-logo.png" class="my-auto w-[400px]" /> + <img + src="/images/bitcoin-logo.png" + class="my-auto w-[400px]" + alt="Bitcoin" + /> <!-- <h3 class="text-5xl font-bold text-center my-auto"> --> <!-- bitcoin --> <!-- </h3> --> @@ -38,10 +42,12 @@ <img src="/images/tap.png" class="w-24 absolute top-52 left-4 rotate-[-10deg]" + alt="Tap" /> <img src="/images/arrow.png" class="w-24 scale-x-[-1] rotate-[120deg] absolute top-52 left-32 w-20 h-52" + alt="Arrow" /> {/if} <Qr {text} icon="icon.png" /> diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte index cd692abf..368af25c 100644 --- a/src/routes/(app)/[username]/receive/+page.svelte +++ b/src/routes/(app)/[username]/receive/+page.svelte @@ -32,14 +32,14 @@ let id = $state(); let { rate, subject, user, text } = $derived(data); - let locale = loc(user); + let locale = $derived(() => loc(user)); - let { currency, username } = subject; + let { currency, username } = $derived(subject); let type = types.lightning; let hash = ""; let qr; - let aid = subject.id; + let aid = $derived(subject.id); let invoice = $derived({ aid, type: types.lightning, |
